#pragma once
#include <string>
#include "http.h"

struct HttpRequest
{
	HttpRequest(void);
	~HttpRequest(void);

	void parse ( const std::string & request_str );
	//const HTTP_VERSION &getVersion();
	HttpMethod method;
	HttpVersion version;
	ConnectionHeader connection;
	std::string resource; //< URI of resource requested.
	HttpStatusCode status_code;
	bool error() const;
	std::string error_dscr;
};


///////////////////////////////////////////////////////////////////////////////
///////////////													///////////////
///////////////			INLINE FUCTIONS IMPLEMENTATION			///////////////
///////////////													///////////////
///////////////////////////////////////////////////////////////////////////////


inline bool HttpRequest::error() const
{
	return status_code == SC_BAD_REQUEST;
}
